const express = require("express");

const app = express();
// 定义两个中间件
app.use((req, res, next) => {
  console.log("第一个中间件函数");
  next();
});

app.use((req, res, next) => {
  console.log("第二个中间件函数");
  next();
});

app.get("/user", (req, res) => {
  console.log("用户访问的/user路由");
});

// 3. 启动服务器
app.listen(8080, () => {
  console.log("http://127.0.0.1:8080");
});
